package com.augurit.gzcgwsp.readAndParseXML;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ConnectException;
import java.net.Socket;
import java.net.UnknownHostException;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		boolean run = false;
        try {
            Socket socket = new Socket("192.168.15.253" , 8888);
            run = socket.isConnected();
        } catch (ConnectException e) {
        	e.printStackTrace();
            System.out.println("tomcat has stop");
        } catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
           
        if (run) {
            System.out.println("tomcat is running");
        } else {
            System.out.println("Start to tomcat");
        }

	}

}
